<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>列表</title>
    <meta name="description" content="Restyling jQuery UI Widgets and Elements"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <link rel="stylesheet" th:href="@{{path}/css/bootstrap.min.css(path=${contextPath})}"/>
    <link rel="stylesheet" th:href="@{{path}/css/font-awesome.min.css(path=${contextPath})}"/>
    <link rel="stylesheet" th:href="@{{path}/css/ace-fonts.css(path=${contextPath})}"/>
    <link rel="stylesheet" th:href="@{{path}/css/pagination.css(path=${contextPath})}"/>
    <link rel="stylesheet" th:href="@{{path}/css/ace.min.css(path=${contextPath})}" id="main-ace-style"/>
    <!--[if lte IE 9]>
    <link rel="stylesheet" th:href="@{{path}/css/ace-part2.min.css(path=${contextPath})}"/>
    <![endif]-->
    <!--[if lte IE 9]>
    <link rel="stylesheet" th:href="@{{path}/css/ace-ie.min.css(path=${contextPath})}"/>
    <![endif]-->
    <script th:src="@{{path}/js/ace-extra.min.js(path=${contextPath})}"></script>
    <!--[if lte IE 8]>
    <script th:src="@{{path}/js/html5shiv.min.js(path=${contextPath})}"></script>
    <script th:src="@{{path}/js/respond.min.js(path=${contextPath})}"></script>
    <![endif]-->
    <style type="text/css">
        .CSSearchTbl {
            border: 1px #008CD4 solid;
        }

        .CSSearchTbl thead {
        }

        .CSSearchTbl thead tr {
        }

        .CSSearchTbl thead tr th {
            text-align: left;
            padding-left: 10px;
        }

        .CSSearchTbl tbody {
        }

        .CSSearchTbl tbody tr {
        }

        .CSSearchTbl tbody tr td {
            padding: 10px;
        }

        .CSSearchTbl tbody tr td.right {
            text-align: left;
        }

        .CSSearchTbl tbody tr td.left {
            text-align: right;
        }

        .table-responsive {
            display: none;
        }

        .M-box11 a {
            border-width: 1px;
            border-color: #d4dfe3;
            border-radius: 0 !important;
            color: #2283c5;
            background-color: #fafafa;
            margin: 0 -1px 0 0;
            position: relative;
            z-index: auto;
            float: left;
            padding: 6px 12px;
            line-height: 1.42857143;
            text-decoration: none;
            border: 1px solid #ddd;
        }

        .M-box11 a:hover, .M-box11 span:hover {
            background-color: #eaefe2;
        }

        .M-box11 span {
            background-color: #6faed9;
            border-color: #6faed9;
            color: #fff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
            z-index: 2;
            float: left;
            padding: 6px 12px;
            line-height: 1.42857143;
            text-decoration: none;
            border: 1px solid #ddd;
            margin: 0 -1px 0 0;
            position: relative;
            border-width: 1px;
            border-radius: 0 !important;
        }

        .M-box11 {
            margin-bottom: 60px;
        }

        .hr {
            display: none;
        }

        .footer .footer-inner .footer-content {
            background-color: #fff;
            width: 100%;
            left: 0;
            right: 0;
        }
    </style>
</head>

<body class="no-skin">
<div class="main-container" id="main-container">
    <!-- #section:basics/sidebar -->
    <div class="main-content">
        <div class="breadcrumbs" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a th:href="@{{path}/manager/homepage(path=${contextPath})}">首页</a>
                </li>
                <li>
                    <a th:href="@{{path}/manager/announcement/list(path=${contextPath})}">阳光公告</a>
                </li>
                <li>
                    <a th:href="@{{path}/manager/announcement/list(path=${contextPath})}">列表</a>
                </li>
            </ul><!-- /.breadcrumb -->

            <!-- #section:basics/content.searchbox -->
            <div class="nav-search" id="nav-search">
                <form class="form-search" id="form-search" method="get" action="list">
							<span class="input-icon">
								<input style="margin: 0;" type="text" placeholder="请输入关键字 ..." class="nav-search-input"
                                       id="nav-search-input" autocomplete="off" name="search" th:value="${search}"/>
								    <i class="ace-icon fa fa-search nav-search-icon" onclick="submit()"></i>
							</span>
                </form>
            </div><!-- /.nav-search -->
        </div>
        <div class="page-content">

            <!-- /section:settings.box -->
            <div class="page-content-area">

                <div class="col-xs-12"
                     style="margin-bottom:20px; border-bottom:1px solid #dddddd; padding-bottom:10px;">
                    <a href="add" style="text-decoration: none;">
                        <button class="btn btn-primary">
                            <i class="ace-icon fa fa-plus-circle align-top bigger-125"></i>
                            新增
                        </button>
                    </a>
                    <button class="btn btn-danger" id="deleteBatch">
                        <i class="ace-icon fa fa-trash-o align-top bigger-125"></i>
                        删除
                    </button>
                </div>

                <div class="row">

                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->

                        <div class="row">
                            <div class="col-xs-12">
                                <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th class="center">
                                            <label class="position-relative">
                                                <input type="checkbox" class="ace" id="selectAll"/>
                                                <span class="lbl"></span>
                                            </label>
                                        </th>
                                        <th>菜单名称</th>
                                        <th>标题</th>
                                        <th>优先级</th>
                                        <th>创建时间</th>
                                        <th class="hidden-480">操作</th>
                                    </tr>
                                    </thead>

                                    <form id="form" action="deleteBatch" method="post">
                                        <tbody>

                                        <tr th:each="announcement,announcementStat : ${page.records}">
                                            <td class="center">
                                                <label class="position-relative">
                                                    <input type="checkbox" class="ace" name="ids"
                                                           th:value="${announcement.id}"/>
                                                    <span class="lbl"></span>
                                                </label>
                                            </td>

                                            <td th:text="${announcement.menu}"></td>
                                            <td th:text="${announcement.title}"></td>
                                            <td th:text="${announcement.sort}"></td>
                                            <td th:text="${null == announcement.createDate || '' == announcement.createDate ? '-' : #dates.format(announcement.createDate,'yyyy-MM-dd HH:mm:ss')}"></td>
                                            <td>
                                                <div class="hidden-sm hidden-xs btn-group">
                                                    <a th:href="@{'view?id='+${announcement.id}}">
                                                        <div class="btn btn-white btn-info btn-bold">
                                                            <i class="ace-icon fa fa-eye bigger-120 blue"></i>
                                                            查看
                                                        </div>
                                                    </a>
                                                    <a th:href="@{'edit?id='+${announcement.id}}">
                                                        <div class="btn btn-white btn-pink btn-round">
                                                            <i class="ace-icon fa fa-pencil red2"></i>
                                                            编辑
                                                        </div>
                                                    </a>
                                                    <a th:href="@{'delete?id='+${announcement.id}}"
                                                       onclick="return comfirmDelete()"
                                                       style="text-decoration: none;">
                                                        <div class="btn btn-white btn-warning btn-bold">
                                                            <i class="ace-icon fa fa-trash-o bigger-120 orange"></i>
                                                            删除
                                                        </div>
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>

                                        </tbody>
                                    </form>
                                </table>
                            </div><!-- /.span -->
                        </div><!-- /.row -->

                        <div class="M-box11"></div>

                        <div class="hr hr-18 dotted hr-double"></div>

                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content-area -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->

</div><!-- /.main-container -->

<!--[if !IE]> -->
<script th:src="@{{path}/js/jquery.min.js(path=${contextPath})}"></script>
<!-- <![endif]-->

<!--[if IE]>
<script th:src="@{{path}/js/jquery1x.min.js(path=${contextPath})}"></script>
<![endif]-->
<script th:src="@{{path}/js/jquery.mobile.custom.min.js(path=${contextPath})}"></script>
<script th:src="@{{path}/js/bootstrap.min.js(path=${contextPath})}"></script>

<script th:src="@{{path}/js/jquery.dataTables.min.js(path=${contextPath})}"></script>
<script th:src="@{{path}/js/jquery.dataTables.bootstrap.js(path=${contextPath})}"></script>

<!-- ace scripts -->
<script th:src="@{{path}/js/ace-elements.min.js(path=${contextPath})}"></script>
<script th:src="@{{path}/js/ace.min.js(path=${contextPath})}"></script>
<script th:src="@{{path}/js/list.js(path=${contextPath})}"></script>
<!-- 分页 -->
<script th:src="@{{path}/js/jquery.pagination.js(path=${contextPath})}"></script>
<script type="text/javascript" th:inline="javascript">
    $('.M-box11').pagination({
        totalData: [[${page.total}]], //数据总条数
        showData: 10, //每页显示的条数
        pageCount: [[${page.pages}]], //总页数,默认为9
        current: [[${page.current}]], //当前第几页
        prevCls: 'prev', //上一页class
        nextCls: 'next', //下一页class
        prevContent: '上页', //上一页内容
        nextContent: '下页', //下一页内容
        activeCls: 'active', //当前页选中状态
        coping: false, //首页和尾页
        isHide: false, //当前页数为0页或者1页时不显示分页
        homePage: '首页', //首页节点内容
        endPage: '尾页', //尾页节点内容
        keepShowPN: false, //是否一直显示上一页下一页
        mode: 'fixed', //分页模式，unfixed：不固定页码数量，fixed：固定页码数量
        count: 4, //mode为unfixed时显示当前选中页前后页数，mode为fixed显示页码总数
        jump: false, //跳转到指定页数
        jumpIptCls: 'jump-ipt', //文本框内容
        jumpBtnCls: 'jump-btn', //跳转按钮
        jumpBtn: '跳转', //跳转按钮文本
        callback: function (api) {
            //<![CDATA[
            var pageNum = api.getCurrent();
            window.location.href = "list?current=" + pageNum + "&search=" + $("#nav-search-input").val();
            //]]>
        }//回调
    });

    function submit() {
        $("#form-search").submit();
    }
</script>

</body>
</html>
